using System;
using NUnit.Framework;
using dnA.Math;

namespace dnA.dnAtests.Math 
{
	[TestFixture]
	public class ComplexMath_Float_ArgumentTest
	{
		[Test]
		public void Argument()
		{
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(0.0f,1.19209289550780998537e-7f)), 1.57079632679489661923, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(0.0f,-1.19209289550780998537e-7f)), -1.57079632679489661923, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(0.0f,5.0e-1f)), 1.57079632679489661923, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(0.0f,-5.0e-1f)), -1.57079632679489661923, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(0.0f,1.0f)), 1.57079632679489661923, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(0.0f,-1.0f)), -1.57079632679489661923, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(0.0f,2.0f)), 1.57079632679489661923, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(0.0f,-2.0f)), -1.57079632679489661923, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(0.0f,8.388608e6f)), 1.57079632679489661923, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(0.0f,-8.388608e6f)), -1.57079632679489661923, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.19209289550780998537e-7f,0.0f)), 0.0, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.19209289550780998537e-7f,0.0f)), 3.14159265358979323846, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.19209289550780998537e-7f,1.19209289550780998537e-7f)), 7.85398163397448309616e-1, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.19209289550780998537e-7f,-1.19209289550780998537e-7f)), -7.85398163397448309616e-1, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.19209289550780998537e-7f,1.19209289550780998537e-7f)), 2.35619449019234492885, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.19209289550780998537e-7f,-1.19209289550780998537e-7f)), -2.35619449019234492885, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.19209289550780998537e-7f,5.0e-1f)), 1.57079608837631751767, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.19209289550780998537e-7f,-5.0e-1f)), -1.57079608837631751767, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.19209289550780998537e-7f,5.0e-1f)), 1.57079656521347572079, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.19209289550780998537e-7f,-5.0e-1f)), -1.57079656521347572079, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.19209289550780998537e-7f,1.0f)), 1.57079620758560706845, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.19209289550780998537e-7f,-1.0f)), -1.57079620758560706845, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.19209289550780998537e-7f,1.0f)), 1.57079644600418617001, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.19209289550780998537e-7f,-1.0f)), -1.57079644600418617001, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.19209289550780998537e-7f,2.0f)), 1.57079626719025184384, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.19209289550780998537e-7f,-2.0f)), -1.57079626719025184384, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.19209289550780998537e-7f,2.0f)), 1.57079638639954139462, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.19209289550780998537e-7f,-2.0f)), -1.57079638639954139462, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.19209289550780998537e-7f,8.388608e6f)), 1.57079632679488240838, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.19209289550780998537e-7f,-8.388608e6f)), -1.57079632679488240838, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.19209289550780998537e-7f,8.388608e6f)), 1.57079632679491083009, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.19209289550780998537e-7f,-8.388608e6f)), -1.57079632679491083009, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(5.0e-1f,0.0f)), 0.0, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-5.0e-1f,0.0f)), 3.14159265358979323846, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(5.0e-1f,1.19209289550780998537e-7f)), 2.38418579101557479565e-7, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(5.0e-1f,-1.19209289550780998537e-7f)), -2.38418579101557479565e-7, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-5.0e-1f,1.19209289550780998537e-7f)), 3.14159241517121413691, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-5.0e-1f,-1.19209289550780998537e-7f)), -3.14159241517121413691, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(5.0e-1f,5.0e-1f)), 7.85398163397448309616e-1, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(5.0e-1f,-5.0e-1f)), -7.85398163397448309616e-1, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-5.0e-1f,5.0e-1f)), 2.35619449019234492885, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-5.0e-1f,-5.0e-1f)), -2.35619449019234492885, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(5.0e-1f,1.0f)), 1.10714871779409050302, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(5.0e-1f,-1.0f)), -1.10714871779409050302, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-5.0e-1f,1.0f)), 2.03444393579570273545, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-5.0e-1f,-1.0f)), -2.03444393579570273545, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(5.0e-1f,2.0f)), 1.32581766366803246506, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(5.0e-1f,-2.0f)), -1.32581766366803246506, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-5.0e-1f,2.0f)), 1.8157749899217607734, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-5.0e-1f,-2.0f)), -1.8157749899217607734, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(5.0e-1f,8.388608e6f)), 1.57079626719025184384, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(5.0e-1f,-8.388608e6f)), -1.57079626719025184384, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-5.0e-1f,8.388608e6f)), 1.57079638639954139462, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-5.0e-1f,-8.388608e6f)), -1.57079638639954139462, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.0f,0.0f)), 0.0, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.0f,0.0f)), 3.14159265358979323846, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.0f,1.19209289550780998537e-7f)), 1.19209289550780433848e-7, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.0f,-1.19209289550780998537e-7f)), -1.19209289550780433848e-7, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.0f,1.19209289550780998537e-7f)), 3.14159253438050368768, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.0f,-1.19209289550780998537e-7f)), -3.14159253438050368768, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.0f,5.0e-1f)), 4.63647609000806116214e-1, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.0f,-5.0e-1f)), -4.63647609000806116214e-1, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.0f,5.0e-1f)), 2.67794504458898712225, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.0f,-5.0e-1f)), -2.67794504458898712225, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.0f,1.0f)), 7.85398163397448309616e-1, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.0f,-1.0f)), -7.85398163397448309616e-1, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.0f,1.0f)), 2.35619449019234492885, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.0f,-1.0f)), -2.35619449019234492885, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.0f,2.0f)), 1.10714871779409050302, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.0f,-2.0f)), -1.10714871779409050302, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.0f,2.0f)), 2.03444393579570273545, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.0f,-2.0f)), -2.03444393579570273545, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.0f,8.388608e6f)), 1.57079620758560706845, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(1.0f,-8.388608e6f)), -1.57079620758560706845, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.0f,8.388608e6f)), 1.57079644600418617001, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-1.0f,-8.388608e6f)), -1.57079644600418617001, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(2.0f,0.0f)), 0.0, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-2.0f,0.0f)), 3.14159265358979323846, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(2.0f,1.19209289550780998537e-7f)), 5.96046447753904286825e-8, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(2.0f,-1.19209289550780998537e-7f)), -5.96046447753904286825e-8, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-2.0f,1.19209289550780998537e-7f)), 3.14159259398514846307, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-2.0f,-1.19209289550780998537e-7f)), -3.14159259398514846307, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(2.0f,5.0e-1f)), 2.44978663126864154172e-1, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(2.0f,-5.0e-1f)), -2.44978663126864154172e-1, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-2.0f,5.0e-1f)), 2.89661399046292908429, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-2.0f,-5.0e-1f)), -2.89661399046292908429, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(2.0f,1.0f)), 4.63647609000806116214e-1, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(2.0f,-1.0f)), -4.63647609000806116214e-1, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-2.0f,1.0f)), 2.67794504458898712225, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-2.0f,-1.0f)), -2.67794504458898712225, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(2.0f,2.0f)), 7.85398163397448309616e-1, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(2.0f,-2.0f)), -7.85398163397448309616e-1, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-2.0f,2.0f)), 2.35619449019234492885, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-2.0f,-2.0f)), -2.35619449019234492885, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(2.0f,8.388608e6f)), 1.57079608837631751767, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(2.0f,-8.388608e6f)), -1.57079608837631751767, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-2.0f,8.388608e6f)), 1.57079656521347572079, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-2.0f,-8.388608e6f)), -1.57079656521347572079, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(8.388608e6f,0.0f)), 0.0, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-8.388608e6f,0.0f)), 3.14159265358979323846, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(8.388608e6f,1.19209289550780998537e-7f)), 1.42108547152019737407e-14, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(8.388608e6f,-1.19209289550780998537e-7f)), -1.42108547152019737407e-14, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-8.388608e6f,1.19209289550780998537e-7f)), 3.14159265358977902761, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-8.388608e6f,-1.19209289550780998537e-7f)), -3.14159265358977902761, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(8.388608e6f,5.0e-1f)), 5.96046447753905544139e-8, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(8.388608e6f,-5.0e-1f)), -5.96046447753905544139e-8, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-8.388608e6f,5.0e-1f)), 3.14159259398514846307, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-8.388608e6f,-5.0e-1f)), -3.14159259398514846307, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(8.388608e6f,1.0f)), 1.19209289550780685311e-7, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(8.388608e6f,-1.0f)), -1.19209289550780685311e-7, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-8.388608e6f,1.0f)), 3.14159253438050368768, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-8.388608e6f,-1.0f)), -3.14159253438050368768, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(8.388608e6f,2.0f)), 2.38418579101557982491e-7, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(8.388608e6f,-2.0f)), -2.38418579101557982491e-7, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-8.388608e6f,2.0f)), 3.1415924151712141369, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-8.388608e6f,-2.0f)), -3.1415924151712141369, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(8.388608e6f,8.388608e6f)), 7.85398163397448309616e-1, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(8.388608e6f,-8.388608e6f)), -7.85398163397448309616e-1, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-8.388608e6f,8.388608e6f)), 2.35619449019234492885, 1e-7f);
			TestHelper.TestRelativeError(ComplexMath.Argument(new ComplexFloat(-8.388608e6f,-8.388608e6f)), -2.35619449019234492885, 1e-7f);
		}
	}
}
